package com.jm.service;

import com.jm.mapper.OrderMapper;
import com.jm.model.Order;
import io.seata.core.context.RootContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service(version = "1.0.0")
@Slf4j
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public void createOrder(Order order) {
        log.info("全局事务id ：" + RootContext.getXID());
        orderMapper.createOrder(order);
        log.info("当前id:{}", order.getId());
    }
}
